package com.shop.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shop.service.Sms_Seckill_Promotion_Service;
import com.shop.pojo.sms.Sms_Seckill_promotion;
import com.shop.utils.LayuiUtils;
import com.shop.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 秒杀活动
 */
@RestController
@RequestMapping("/seckill_promotion")
public class Sms_Seckill_Promotion_Controller {

    @Autowired
    private Sms_Seckill_Promotion_Service sms_seckill_promotion_service;

    /**
     *秒杀活动的显示所有
     * @param page
     * @param limit
     * @param ssp
     * @return
     */
    @GetMapping("/find_admin_seckill_promotion_All")
    public LayuiUtils<Sms_Seckill_promotion>  find_admin_seckill_promotion_All(Integer page,Integer limit,Sms_Seckill_promotion ssp){

        Page<Sms_Seckill_promotion>  Pages = new Page<>(page,limit);

        return sms_seckill_promotion_service.find_admin_seckill_promotion_All(Pages,ssp);

    }

    /**
     * 秒杀活动的新增
     * @param ssp
     * @return
     */
    @PostMapping("/insert_admin_seckill_promotion_All")
    public R insert_admin_seckill_promotion_All(Sms_Seckill_promotion ssp){

        return sms_seckill_promotion_service.insert_admin_seckill_promotion_All(ssp);
    }

    /***
     * 秒杀活动的删除
     * @param id
     * @return
     */
    @DeleteMapping("/del_admin_seckill_promotion_All")
    public R del_admin_seckill_promotion_All(@RequestParam List<Integer> id){

        return sms_seckill_promotion_service.del_admin_seckill_promotion_All(id);
    }


    /**
     * 秒杀活动的修改
     * @param ssp
     * @return
     */
    @PutMapping("/up_admin_seckill_promotion_All")
    public R up_admin_seckill_promotion_All(Sms_Seckill_promotion ssp){

        return sms_seckill_promotion_service.up_admin_seckill_promotion_All(ssp);
    }



}
